﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Sitemap.ascx.cs" Inherits="VLUNewsUI.VLUSitemap.Sitemap" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="SectionHead" Src="~/controls/SectionHeadControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Url" Src="~/controls/UrlControl.ascx" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>

<div class="dnnActions dnnClear">
    <asp:DataList ID="dtlParent" runat="server" RepeatDirection="Horizontal" 
        ShowFooter="False" ShowHeader="False">
        <ItemTemplate>
            <dnn:CommandButton Text='<%# Eval("Value") %>' CommandArgument='<%# Eval("Key") %>' DisplayIcon="false" ID="cmdParent" runat="server" />
        </ItemTemplate>
    </asp:DataList>
</div>

<div class="dnnForm dnnSecurityRoles">
	<asp:datagrid id="dgdSitemap" Width="98%" AutoGenerateColumns="False" 
        runat="server" BorderStyle="None" GridLines="None" CssClass="dnnGrid">
        <headerstyle cssclass="dnnGridHeader" verticalalign="Top"/>
	    <itemstyle cssclass="dnnGridItem" horizontalalign="Left"/>
	    <alternatingitemstyle cssclass="dnnGridAltItem" />
	    <edititemstyle cssclass="dnnFormInput" />
	    <selecteditemstyle cssclass="dnnFormError" />
	    <footerstyle cssclass="dnnGridFooter" />
	    <pagerstyle cssclass="dnnGridPager" />
		<columns>
			<dnn:imagecommandcolumn commandname="Select" IconKey="Select" keyfield="SitemapID" />
		    <asp:boundcolumn DataField="SitemapID" HeaderText="SitemapID" Visible="false"/>
		    <asp:boundcolumn DataField="SitemapName" HeaderText="SitemapName" />
            <%--IsSecurity--%>
			<asp:TemplateColumn>
            <HeaderTemplate>
                <dnn:Label ID="colIsSecurity" runat="server" ResourceKey="IsSecurity"/>
            </HeaderTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="chbIsSecurity" runat="server" Checked='<%# Eval("IsSecurity") %>' Enabled="false"/>
            </ItemTemplate>
            </asp:TemplateColumn>
		    <%--<asp:boundcolumn DataField="IsSecurity" HeaderText="IsSecurity" />--%>
		</columns>
	</asp:datagrid>
</div>

<div class="dnnForm dnnEditSitemap dnnClear" id="dnnEditSitemap">
    <div class="erBasicSettings" id="erBasicSettings">
        <div class="erbsContent dnnClear">
            <fieldset>
                <div class="dnnFormItem">
                    <dnn:Label ID="plSitemapName" runat="server" ResourceKey="SitemapName" ControlName="txtSitemapName" />
                    <asp:TextBox ID="txtSitemapName" runat="server" CssClass="dnnFormRequired" MaxLength="50" />
                    <asp:RequiredFieldValidator ID="valSitemapName" CssClass="dnnFormMessage dnnFormError" runat="server" resourcekey="valSitemapName" ControlToValidate="txtSitemapName" Display="Dynamic" />
                    <%--<asp:RegularExpressionValidator ID="valSitemapName2" 
                        CssClass="dnnFormMessage dnnFormError" runat="server" 
                        resourcekey="valSitemapName2" ControlToValidate="txtSitemapName" 
                        Display="Dynamic" ValidationExpression="\w+([-.]\w+)*\.\w+([-.]\w+)*" />--%>
                </div>
                <div class="dnnFormItem">
                    <dnn:Label ID="plURL" runat="server" ResourceKey="URL" ControlName="txtURL" />
                    <asp:TextBox ID="txtURL" runat="server" MaxLength="1000"/>
                </div>
                <div class="dnnFormItem">
                    <dnn:Label ID="plIsSecurity" runat="server" ResourceKey="IsSecurity" ControlName="txtIsSecurity" />
                    <asp:CheckBox ID="chbIsSecurity" runat="server"/>
                </div>
                <div class="dnnFormItem">
                    <dnn:Label ID="plSortOrder" runat="server" ResourceKey="SortOrder" ControlName="txtURL" />
                    <asp:TextBox ID="txtSortOrder" runat="server" Text="1" MaxLength="5"/>
                    <asp:RegularExpressionValidator ID="valSortOrder" 
                        CssClass="dnnFormMessage dnnFormError" runat="server" 
                        resourcekey="valSortOrder" ControlToValidate="txtSortOrder" 
                        Display="Dynamic" ValidationExpression="^[0-9]+$" />
                </div>
            </fieldset>
        </div>
    </div>
    <ul class="dnnActions dnnClear">
        <li><asp:LinkButton ID="cmdUpdate" resourcekey="cmdUpdate" runat="server" CssClass="dnnPrimaryAction" /></li>
        <li><asp:LinkButton ID="cmdDelete" resourcekey="cmdDelete" runat="server" CssClass="dnnSecondaryAction dnnDeleteSitemap" CausesValidation="False" /></li>
        <li><asp:LinkButton ID="cmdCancel" resourcekey="cmdCancel" runat="server" CssClass="dnnSecondaryAction dnnCancelSitemap" CausesValidation="False" /></li>
        <%--<li><asp:HyperLink ID="cmdCancel" resourcekey="cmdCancel" runat="server" CssClass="dnnSecondaryAction" CausesValidation="False" /></li>--%>
    </ul>
</div>

<script language="javascript" type="text/javascript">
    /*globals jQuery, window, Sys */
    (function ($, Sys) {
        function setUpDnnEditSitemaps() {
            $('#dnnEditSitemap').dnnTabs();
            var yesText = '<%= Localization.GetSafeJSString("Yes.Text", Localization.SharedResourceFile) %>';
            var noText = '<%= Localization.GetSafeJSString("No.Text", Localization.SharedResourceFile) %>';
            var titleText = '<%= Localization.GetSafeJSString("Confirm.Text", Localization.SharedResourceFile) %>';
            $('#<%= cmdDelete.ClientID %>').dnnConfirm({
                text: '<%= DotNetNuke.UI.Utilities.ClientAPI.GetSafeJSString(LocalizeString("DeleteItem")) %>',
                yesText: yesText,
                noText: noText,
                title: titleText
            });

            };

            updateView();
        }
        $(document).ready(function () {
            setUpDnnEditSitemaps();
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
                setUpDnnEditSitemaps();
            });
        });
    } (jQuery, window.Sys));
</script>